import bb.cascades 1.0

Container {
    background: Color.create("#152d56")
    preferredWidth: 384
    preferredHeight: 420
    layout: DockLayout {
    }
//    ImageView {
//        imageSource: "asset:///images/btnNormal.png"
//        verticalAlignment: VerticalAlignment.Fill
//        horizontalAlignment: HorizontalAlignment.Fill
//        objectName: "img"
//    }
    Label {
        id: lb1
        objectName: "lbl"
        text: "text"
        textStyle.fontSizeValue: 13
        horizontalAlignment: HorizontalAlignment.Center
        verticalAlignment: VerticalAlignment.Center
        textStyle.color: Color.White
        textStyle.fontFamily: "Arial"
        touchPropagationMode: TouchPropagationMode.PassThrough
        onTouch: {
            changeImg();
        }
    } // end label
        ImageButton {
            id: btn
            defaultImageSource: "asset:///images/btnNormal.png"
            pressedImageSource: "asset:///images/btnTouch.png"
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
        }
    onCreationCompleted: {
        //background = Color.create('#' + Math.floor(Math.random() * 16777215).toString(16))
    }
    onTouch: {
        //lbl.setTranslationX(100);
    }
    attachedObjects: [
        ImplicitAnimationController {
            propertyName: "translationX"
            enabled: false
        }
    ]
    
    function changeImg () {
        btn.setDefaultImageSource("asset:///images/btnTouch.png");
        btn.setDefaultImageSource("asset:///images/btnNormal.png");
    }
}
